package vip.liux.front.infrastructure.constants;

import com.google.common.util.concurrent.Striped;

import java.util.concurrent.locks.Lock;

public class LockConstants {
    private final static Striped<Lock> stripedLocks = Striped.lock(20);

    /**
     * 获取锁
     *
     * @param key 锁的key
     * @return 锁
     */
    public static Lock getLock(String key) {
        return stripedLocks.get(key);
    }
}
